//
// Decompiled by Jadx - 357ms
//
package me.plusne.Adapter.Login;

import cc.p;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import fi.a;
import fi.c;
import fi.w;
import fn.b;
import java.io.File;
import java.util.ArrayList;
import java.util.Objects;
import me.plusne.Adapter.Login.HookSetListAdapter;
import me.plusne.common.Json.Login.JsonLoginQuerySet;

public final class f implements w.d, w.e, w.f, w.b, w.c {
    public final int a;
    public final HookSetListAdapter.a b;
    public final JsonLoginQuerySet.SetBean c;
    public final HookSetListAdapter d;

    public f(HookSetListAdapter.a aVar, JsonLoginQuerySet.SetBean setBean, HookSetListAdapter hookSetListAdapter, int i) {
        this.a = i;
        this.b = aVar;
        this.c = setBean;
        this.d = hookSetListAdapter;
    }

    public final void e(ArrayList arrayList) {
        int i = this.a;
        HookSetListAdapter hookSetListAdapter = this.d;
        JsonLoginQuerySet.SetBean setBean = this.c;
        HookSetListAdapter.a aVar = this.b;
        switch (i) {
            case 0:
                aVar.getClass();
                Gson create = new GsonBuilder().registerTypeAdapter(a.class, new HookSetListAdapter.CustomSerializer()).create();
                if (!Objects.equals(new Gson().toJson(arrayList), "[]")) {
                    b.l(create.toJson(arrayList), setBean.getKey());
                    hookSetListAdapter.notifyItemChanged(aVar.getAbsoluteAdapterPosition());
                    aVar.k(setBean);
                    return;
                }
                return;
            default:
                aVar.getClass();
                if (!Objects.equals(new Gson().toJson(arrayList), "[]")) {
                    b.l(new Gson().toJson(arrayList), setBean.getKey());
                    hookSetListAdapter.notifyItemChanged(aVar.getAbsoluteAdapterPosition());
                    aVar.k(setBean);
                    return;
                }
                return;
        }
    }

    public final void f(File file) {
        HookSetListAdapter.a aVar = this.b;
        aVar.getClass();
        JsonLoginQuerySet.SetBean setBean = this.c;
        b.l(file.getPath(), setBean.getKey());
        this.d.notifyItemChanged(aVar.getAbsoluteAdapterPosition());
        aVar.k(setBean);
    }

    public final void g(w wVar, boolean z) {
        HookSetListAdapter.a aVar = this.b;
        aVar.getClass();
        if (z) {
            JsonLoginQuerySet.SetBean setBean = this.c;
            b.l(Integer.valueOf(((p) wVar.f).g.getProgress() + wVar.an), setBean.getKey());
            aVar.e.setText(String.valueOf(((p) wVar.f).g.getProgress() + wVar.an));
            this.d.notifyItemChanged(aVar.getAbsoluteAdapterPosition());
            aVar.k(setBean);
        }
    }

    public final void h(String str, String str2, w wVar, boolean z) {
        int i = this.a;
        HookSetListAdapter hookSetListAdapter = this.d;
        JsonLoginQuerySet.SetBean setBean = this.c;
        HookSetListAdapter.a aVar = this.b;
        switch (i) {
            case 3:
                aVar.getClass();
                if (z) {
                    b.l(str, setBean.getKey());
                    hookSetListAdapter.notifyItemChanged(aVar.getAbsoluteAdapterPosition());
                    aVar.k(setBean);
                    return;
                }
                return;
            default:
                aVar.getClass();
                if (z) {
                    b.l(str, setBean.getKey());
                    hookSetListAdapter.notifyItemChanged(aVar.getAbsoluteAdapterPosition());
                    aVar.k(setBean);
                    return;
                }
                return;
        }
    }

    public final void i(w wVar, c.a aVar, int i, int i2) {
        HookSetListAdapter.a aVar2 = this.b;
        aVar2.getClass();
        StringBuilder sb = new StringBuilder();
        JsonLoginQuerySet.SetBean setBean = this.c;
        sb.append(setBean.getKey());
        sb.append("_text");
        b.l(aVar.getTitle(), sb.toString());
        b.l(aVar.getKey(), setBean.getKey());
        this.d.notifyItemChanged(aVar2.getAbsoluteAdapterPosition());
        wVar.az();
        aVar2.k(setBean);
    }
}
